package com.fare.taluo.vo.taobaoPriceRubik;

import java.util.ArrayList;
import java.util.List;

import com.fare.taluo.util.DateUtils;
import com.fare.taluo.vo.core.AgentEntityVO;

/**
 * 组装的taobao价格魔方图表视图对象
 * @author gan 2013-10-30
 *
 */
public class TaobaoPriceRubikVO {

	/**
	 * //航班号
	 */	
	private String flightId;
	/**
	 * 代理人最低价(含20元保险）
	*/
	private String lowerPrice;
	
	/**
	 * //旗舰店-淘宝差价
	*/
	private String differencePirce;
	/**
	 * //旗舰店最低价
	 */	
	private String agentLowerPrice;
	/**
	 * //航空公司简称英文，如：MU
	*/
	private String carrierKey;
	/**
	 * //航空公司
	*/
	private String carrierName;
	/**
	 * //出发城市和到达城市的rowKey
	*/
	private String fromAndTocityKey;
	/**
	 * //出发城市和到达城市的name
	*/
	private String fromAndCityName;
	private String fromCity;
	private String toCityName;
	private String toCity;
	/**
	 * 抓取时间 12312323423时间戳
	 */
	private String grabDate;
	private String grapDateStr;
	/**
	 * 代理商信息,在本VO主要用到price=旗舰店最低价，type=0 时表是旗舰店
	 */
	private List<AgentEntityVO> agents = new ArrayList<AgentEntityVO>();
	
	public String getGrapDateStr() {
		if(grabDate!=null){
			grapDateStr=DateUtils.getPageDateStr2(grabDate,"yyyy-MM-dd HH:mm");
			return grapDateStr;
		}else{
			return null;
		}
	}
	public void setGrapDateStr(String grapDateStr) {
		this.grapDateStr = grapDateStr;
	}
	
	public String getAgentLowerPrice() {
	//	agentLowerPrice=agents.get(0).getPrice();//是不是第一个List呢，会不会出现多个list呢？？
		return agentLowerPrice;
	}
	public void setAgentLowerPrice(String agentLowerPrice) {
		this.agentLowerPrice = agentLowerPrice;
	}
	
	public String getDifferencePirce() {
		differencePirce=Integer.toString((Integer.parseInt(agentLowerPrice.split("\\.")[0])-Integer.parseInt(lowerPrice.split("\\.")[0])));
		return differencePirce;
	}
	public void setDifferencePirce(String differencePirce) {
		this.differencePirce = differencePirce;
	}
	public String getCarrierKey() {
		return carrierKey;
	}
	public void setCarrierKey(String carrierKey) {
		this.carrierKey = carrierKey;
	}
	public String getCarrierName() {
		return carrierName;
	}
	public void setCarrierName(String carrierName) {
		this.carrierName = carrierName;
	}
	public String getFromAndTocityKey() {
		return fromAndTocityKey;
	}
	public void setFromAndTocityKey(String fromAndTocityKey) {
		this.fromAndTocityKey = fromAndTocityKey;
	}
	public String getFlightId() {
		return flightId;
	}
	public void setFlightId(String flightId) {
		this.flightId = flightId;
	}
	public String getLowerPrice() {
		return lowerPrice;
	}
	public void setLowerPrice(String lowerPrice) {
		this.lowerPrice = lowerPrice;
	}
	public String getFromAndCityName() {
		return fromAndCityName;
	}
	public void setFromAndCityName(String fromAndCityName) {
		this.fromAndCityName = fromAndCityName;
	}
	public String getFromCity() {
		return fromCity;
	}
	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}
	public String getToCityName() {
		return toCityName;
	}
	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}
	public String getToCity() {
		return toCity;
	}
	public void setToCity(String toCity) {
		this.toCity = toCity;
	}
	
	public String getGrabDate() {
		return grabDate;
	}
	public void setGrabDate(String grabDate) {
		this.grabDate = grabDate;
	}
	public List<AgentEntityVO> getAgents() {
		return agents;
	}
	public void setAgents(List<AgentEntityVO> agents) {
		this.agents = agents;
	}
	
	
	
}
